<template>
  <div>
    {{ id }}
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="(item, index) in banner" :key="index">
        <img class="bannerimg" :src="item.src" alt="" />
      </van-swipe-item>
    </van-swipe>

    <h4>{{ desc.title }}</h4>
    <div v-html="desc.content" class="con"></div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      id: this.$route.query.id,
      banner: [],
      desc: {},
    };
  },
  created() {
    this.getBanner();
    this.getDesc();
  },
  methods: {
    getBanner() {
      this.$axios
        .get("http://www.liulongbin.top:3005/api/getthumimages/" + this.id)
        .then((res) => {
          console.log(res);
          this.banner = res.data.message;
        });
    },
    getDesc() {
      this.$axios
        .get("http://www.liulongbin.top:3005/api/goods/getdesc/" + this.id)
        .then((res) => {
          console.log(res);
          this.desc = res.data.message[0];
        });
    },
  },
};
</script>
<style lang="scss">
.bannerimg {
  width: 100%;
  height: 200px;
}
.con img {
  width: 100% !important;
}
</style>
